1. Field of the Invention
The present invention relates to a machine tool control system controlling an NC machine tool in accordance with a machining program, and to a workpiece origin setting method for setting a workpiece origin when the workpiece is going to be machined in the NC machine tool.
2. Description of the Related Art
For operating NC machine tools such as an NC milling machine or machining center, it is necessary to place a workpiece on the machining table of the machine tool, and, before staring machining, obtain a predetermined position on the placed workpiece as the workpiece origin to create a machining program using the workpiece origin as a reference point. As the workpiece origin, it is necessary to use coordinates of a predetermined position on the workpiece in the machine coordinate system for the machine tool.
In general, such coordinates of a workpiece origin are obtained by employing a method that uses a touch probe and a tool setter. The method will now be described more specifically.
For example, when the workpiece origin for machining a substantially cuboid-shaped workpiece in a vertical machining center is the center of the top face of the workpiece, the machine operator starts with placing the workpiece on the machining table of the vertical machining center, and attaches a touch probe, instead of a machining tool, to the main spindle. Then, the machine operator uses a manual pulse generator to move the machining table in the x-axis direction and in the y-axis direction from the machine origin so that the stylus of the touch probe comes into contact with each end face of the workpiece. The machine operator then determines positional coordinates of each end face of the workpiece in the machine coordinate system, based on the amounts of movement of the machining table in the X-axis and Y-axis directions when the touch probe contacts the workpiece. In addition, the machine operator calculates positional coordinates corresponding to the center of the top face of the workpiece, based on the positional coordinates of each end face in the machine coordinate system. Then, the machine operator sets the calculated positional coordinates into the machining program, as the workpiece origin in the X-axis and Y-axis directions. The terms “X-axis direction” and “Y-axis direction” as used herein mean the horizontal direction and the front-to-back direction, respectively, of a vertical machining center.
The machine operator proceeds to set the workpiece origin in the Z-axis direction, i.e., the vertical direction, of the vertical machining center. For this purpose, the machine operator places a tool setter on the top face of the workpiece on the machining table, attaches to the main spindle the machining tool to be used for machining the workpiece, and sets the type of the machining tool into the machining program. Then, the machine operator uses a manual pulse generator to move the main spindle from the height of the origin in the −Z-axis direction (downward) so that the tip of the machining tool comes into contact with the tool setter. In addition, the machine operator calculates the positional coordinate of the top face of the workpiece in the machine coordinate system, by subtracting the height of the tool setter from the amount of movement of the main spindle in the −Z-axis direction when the tool setter is contacted. Then, the machine operator sets the calculated positional coordinate into the machining program as the workpiece origin in the Z-axis direction.
Workpiece origins have conventionally been determined by using a method as described above, whereas Japanese Examined Patent Application Publication No. 08-00350 proposes a method for improving positional accuracy of a workpiece origin. Japanese Examined Patent Application Publication No. 08-00350 describes the method provided below to be used for setting a workpiece origin by attaching a touch sensor to the main spindle to bring the sensor into contact with an end face of the workpiece. According to the patent application, a touch sensor is moved at a high speed from the start point to an end face of the workpiece. After the touch censor is turned on, it is moved backward at a very low speed to be turned off, at which moment the position is measured, and then the touch sensor is returned to the start point at a high speed; then, the touch sensor is rotated around the main spindle 180° and subjected to the same procedure again. The patent application states that such method provides the effect of avoiding measurement errors attributable to an eccentricity of the main spindle.
Japanese Utility Model Application Laid-open Publication No. 62-085343 discloses a method for setting a workpiece origin using a camera, without using any touch detectors such as the above-mentioned touch sensor, tool setter, or any touch sensor. Specifically, Japanese Utility Model Application Laid-open Publication No. 62-085343 discloses that when an operator moves a cursor attached to the camera to align the cursor with the center of a workpiece while watching an image taken by the camera attached to the headstock of a machine tool, a computing apparatus calculates the center position of the workpiece from the position of the camera attached to the machining tool and from the position of the cursor on the camera.
However, the method disclosed in Japanese Examined Patent Application Publication No. 08-00350 is problematic in that a lot of time and labor are needed because the machine operator needs to attach a touch detector, such as a touch sensor, to the main spindle and bring the touch detector and the workpiece into contact with each other.
The method disclosed in Japanese Utility Model Application Laid-open Publication No. 62-085343 is also problematic in that it takes time to obtain a workpiece origin because the operator needs to control the cursor on the camera while watching an image taken by the camera.